<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			var arr = "0123456789";
			document.write("字符初始化为："+arr+"<br/>");
			document.write("字符串的长度为："+arr.length+"<br/>");
			document.write("3在："+arr.indexOf('3')+"的位置，索引为7的是："+arr.indexOf(7)+"<br/>");
			document.write("从3开始截取前3个字符："+arr.substr(3,3)+"<br/>");
			document.write("从3开始截取到8(左闭右开)："+arr.substring(3,9)+"<br/>");
			document.write("aaa变为大写："+"aaa".toLocaleUpperCase()+"<br/>");
			document.write("BBB变为小写："+"BBB".toLowerCase()+"<br/>");
			document.write("去除&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a b c d的空格："+"      a b c d".trim()+"<br/>");
			document.write("去除a b c d的空格："+"a b c d".replace(' ','')+"<br/>");
			document.write("去除a b c d的空格："+"a b c d".replace(/\s/g,'')+"<br/>");
		</script>
		
	</body>
</html>
